package com.yzt.zhuju.arouter;

import android.app.Activity;

import com.alibaba.android.arouter.launcher.ARouter;

import static com.yzt.zhuju.arouter.RouterAccount.AccountRequestCode.REQUEST_CODE_LOGIN;
import static com.yzt.zhuju.arouter.RouterAccount.AccountRequestCode.REQUEST_FORGET_PASSWD_CODE;
import static com.yzt.zhuju.arouter.RouterAccount.AccountRequestCode.REQUEST_PASSWD_LOGIN;
import static com.yzt.zhuju.arouter.RouterAccount.AccountRequestCode.REQUEST_VERIFY_CODE;

/**
 * author : bob
 * date   : 2022/11/29
 * desc   :
 */
public class RouterAccount {

    //登陆页面
    public static final String ACTIVITY_LOGIN = "/login/LoginActivity";

    //密码登陆
    public static final String ACTIVITY_PASSWORD_LOGIN = "/login/PasswordLoginActivity";

    //验证码登陆
    public static final String ACTIVITY_SMS_LOGIN = "/login/SMSLoginActivity";

    //重置手机号
    public static final String ACTIVITY_RESET_PHONE = "/login/ResetPhoneActivity";

    //找回密码
    public static final String ACTIVITY_FIND_PASSWORD = "/login/FindPasswordActivity";

    //重置密码
    public static final String ACTIVITY_RESET_PASSWORD = "/login/ResetPasswordActivity";

    //获取验证码
    public static final String ACTIVITY_VERIFY_CODE = "/login/GetCodeActivity";

    //举报
    public static final String ACTIVITY_REPORT = "/report/ReportActivity";

    // 选择性别
    public static final String ACTIVITY_REGISTER_CHOOSE_GENDER = "/register/RegisterChooseGenderActivity";

    //国家或地区区号
    public static final String ACTIVITY_SELECT_ZONE = "/select/SelectCountryAndZoneCodeActivity";

    //输入验证码
    public class AccountRequestCode {
        /**
         * 密码登录
         */
        public static final int REQUEST_PASSWD_LOGIN = 0x00001;
        /**
         * 选择国家/地区
         */
        public static final int REQUEST_SELECT_ZONE = 0x00002;
        /**
         * 验证码登录
         */
        public static final int REQUEST_CODE_LOGIN = 0x00003;
        /**
         * 验证码校验
         */
        public static final int REQUEST_VERIFY_CODE = 0x00004;
        /**
         * 忘记密码
         */
        public static final int REQUEST_FORGET_PASSWD_CODE = 0x00005;
        /**
         * 重置密码
         */
        public static final int REQUEST_RESET_PASSWD_CODE = 0x00006;
    }

    /**
     * 跳转登陆页面
     */
    public static void LoginActivity(int comeInType) {
        ARouter.getInstance().build(ACTIVITY_LOGIN).withInt("comeInType", comeInType).navigation();
    }

    /**
     * 跳转登陆页面
     */
    public static void LoginActivity(int comeInType, String content) {
        ARouter.getInstance().build(ACTIVITY_LOGIN).withInt("comeInType", comeInType).withString("content", content).navigation();
    }

    /**
     * 选择性别
     */
    public static void RegisterChooseGenderActivity() {
        ARouter.getInstance().build(ACTIVITY_REGISTER_CHOOSE_GENDER).navigation();
    }

    /**
     * 重制手机号
     */
    public static void ResetPhoneActivity() {
        ARouter.getInstance().build(ACTIVITY_RESET_PHONE).navigation();
    }

    /**
     * 验证码登陆
     */
    public static void SMSLoginActivity(Activity mActivity, String mobile, String zone, int type, boolean isAgree) {
        ARouter.getInstance().build(ACTIVITY_SMS_LOGIN).withString("mobile", mobile).withString("zone", zone).withInt("type", type).withBoolean("isAgree", isAgree).navigation(mActivity, REQUEST_CODE_LOGIN);
    }

    /**
     * 密码登陆
     */
    public static void PasswordLoginActivity(Activity mActivity, String mobile, String zone, int type, boolean isAgree) {
        ARouter.getInstance().build(ACTIVITY_PASSWORD_LOGIN).withString("mobile", mobile).withString("zone", zone).withInt("type", type).withBoolean("isAgree", isAgree).navigation(mActivity, REQUEST_PASSWD_LOGIN);
    }

    /**
     * 找回密码
     * 1 设置密码 2 忘记密码
     */
    public static void FindPasswordActivity(Activity mActivity, int type) {
        ARouter.getInstance().build(ACTIVITY_FIND_PASSWORD).withInt("type", type).navigation(mActivity, REQUEST_FORGET_PASSWD_CODE);
    }

    /**
     * 重置密码
     */
    public static void ResetPasswordActivity(Activity mActivity, String mobile, String zone, String cookie) {
        ARouter.getInstance().build(ACTIVITY_RESET_PASSWORD)
                .withString("mobile", mobile)
                .withString("zone", zone)
                .withString("cookie", cookie)
                .navigation(mActivity, AccountRequestCode.REQUEST_RESET_PASSWD_CODE);
    }

    /**
     * 验证码校验
     */
    public static void VerifyCodeActivity(Activity mActivity, String mobile, String zone, int type) {
        ARouter.getInstance().build(ACTIVITY_VERIFY_CODE).
                withString("mobile", mobile).
                withString("zone", zone).
                withInt("type", type).
                navigation(mActivity, REQUEST_VERIFY_CODE);
    }

    /**
     * 举报
     */
    public static void ReportActivity(String userId) {
        ARouter.getInstance().build(ACTIVITY_REPORT).withString("mUserId", userId).navigation();
    }

    /**
     * 选择国家/地区
     */
    public static void RegisterSelectZone(Activity mActivity) {
        ARouter.getInstance().build(ACTIVITY_SELECT_ZONE).navigation(mActivity, AccountRequestCode.REQUEST_SELECT_ZONE);
    }

    /**
     * 选择国家/地区
     *
     * @param isSelectCountry 是否是选择国家
     */
    public static void RegisterSelectZone(Activity mActivity, boolean isSelectCountry, String extraCountry) {
        ARouter.getInstance().build(ACTIVITY_SELECT_ZONE).withBoolean("isSelectCountry", isSelectCountry).withString("extraCountry", extraCountry).navigation(mActivity, AccountRequestCode.REQUEST_SELECT_ZONE);
    }

}
